package com.slipper.sfts.market.front;

import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

import com.slipper.common.bo.Result;
import com.slipper.common.util.ResultUtil;
import com.slipper.sfts.api.market.bo.MarketBO;
import com.slipper.sfts.api.market.service.IMarketSv;
import com.slipper.sfts.market.service.MarketService;

import java.util.List;

@RestController
public class MarketSv implements IMarketSv {
    @Resource
    private MarketService marketService;
    
    @Override
    public Result<MarketBO> queryBy(String id) {
        return ResultUtil.successResult(marketService.queryBy(id));
    }

    @Override
    public Result<List<MarketBO>> queryList(MarketBO bo) {
        return ResultUtil.successResult(marketService.queryList(bo));
    }
    
    @Override
    public Result<List<MarketBO>> queryPage(MarketBO bo) {
        return ResultUtil.successResult(marketService.queryPage(bo));
    }
    
    @Override
    public Result<?> save(MarketBO bo) {
        return ResultUtil.saveResult(marketService.save(bo), bo);
    }
    
    @Override
    public Result<?> delete(MarketBO bo) {
        return ResultUtil.deleteResult(marketService.delete(bo));
    }
}
